package cc.yugu.yhdw.webserver.persistence.hdw;

import cc.yugu.yhdw.common.domain.hdw.CabinetStrategy;
import cc.yugu.yhdw.common.persistence.MasterMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
/**
 * 终端策略信息
 *
 * @Date:Created in 2018/6/30 13:55
 * @Author:
 * @Modified By: zjn 2018/6/30 13:55
 */
public interface CabinetStrategyMapper extends MasterMapper {
    /**
    * 按条件查询表hdw_cabinet_strategy，并统计行数(1行)
    *
    * @Param: [property, value]
    * @Return: int
    * @Author By: zjn 2018/6/30  13:55
    */
    public int hasRecordByProperty(@Param("property") String property, @Param("value") Object value);
    /**
    * 根据主键查询
    *
    * @Param: [id]
    * @Return: cc.yugu.yhdw.common.domain.hdw.CabinetStrategy
    * @Author By: zjn 2018/6/30  13:55
    */
    public CabinetStrategy find(int id);
    /**
    * 按条件查询，并将查询结果按照主键降序排列
    *
    * @Param: [agentId, agencyId]
    * @Return: java.util.List<cc.yugu.yhdw.common.domain.hdw.CabinetStrategy>
    * @Author By: zjn 2018/6/30  13:55
    */
    public List<CabinetStrategy> findByAgency(@Param("agentId") Integer agentId, @Param("agencyId") Integer agencyId);
    /**
    * 按条件查询，返回行数
    *
    * @Param: [search]
    * @Return: int
    * @Author By: zjn 2018/6/30  13:56
    */
    public int findPageCount(CabinetStrategy search);
    /**
    * 分页查询
    *
    * @Param: [search]
    * @Return: java.util.List<cc.yugu.yhdw.common.domain.hdw.CabinetStrategy>
    * @Author By: zjn 2018/6/30  13:56
    */
    public List<CabinetStrategy> findPageResult(CabinetStrategy search);
    /**
    * 插入
    *
    * @Param: [entity]
    * @Return: int
    * @Author By: zjn 2018/6/30  13:56
    */
    public int insert(CabinetStrategy entity);
    /**
    * 根据主键更新
    *
    * @Param: [entity]
    * @Return: int
    * @Author By: zjn 2018/6/30  13:56
    */
    public int update(CabinetStrategy entity);
    /**
    * 根据主键删除
    *
    * @Param: [id]
    * @Return: int
    * @Author By: zjn 2018/6/30  13:56
    */
    public int delete(int id);
    /**
    * 根据运营商id删除
    *
    * @Param: [id]
    * @Return: int
    * @Author By: zjn 2018/6/30  13:56
    */
    public int deleteByAgent(int id);
    /**
    * 根据代理商id删除
    *
    * @Param: [id]
    * @Return: int
    * @Author By: zjn 2018/6/30  13:56
    */
    public int deleteByAgency(int id);
}
